#ifndef QPLOTSETTINGS_H
#define QPLOTSETTINGS_H

#include <QWidget>
#include <QCheckBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QSpinBox>
#include <QPushButton>
#include <QPalette>
#include <QColorDialog>
#include <QTableWidget>
#include <QGroupBox>
#include <QHeaderView>
#include <QList>
#include <QMessageBox>

#include "qparser.h"

class QPlotSettings : public QWidget
{
  Q_OBJECT
public:
  QPlotSettings(QWidget *parent = 0);

signals:
  void buffSize(int);
  void curveColor(QColor);
  void canvasColor(QColor);
  void gridColor(QColor);
  void gridToggle(bool);
  void curveWidth(int);
  void takeSnapshot();
  void plotSelectionChanged(QList<bool>);

public slots:
  void buildTable(QList<variable>);
  void newVariable(variable);
  void removeVariable(int);
  void editVariable(int,variable);

private:
  // GUI COMPONENTS
  // Foreground
  // Points
  QMessageBox checkMsg;
  QGroupBox *dataBox;
  QLabel *ptsDisplayed;
  QSpinBox *noptsSpin;
  QPushButton *ptscolorButton;
  QLabel *ptscolorLabel;
  QLabel *ptswidthLabel;
  QSpinBox *ptswidthSpin;
  QList<variable> variableList;
  //QPushButton *snapButton;

  // Canvas
  QGroupBox *canvasBox;
  QLabel *bgcolorLabel;
  QPushButton *bgcolorButton;
  QLabel *gridCheckLabel;
  QCheckBox *gridCheck;
  QLabel *gridcolorLabel;
  QPushButton *gridcolorButton;

  // Points chooser
  QTableWidget *variableListWidget;

  // Layouts
  QHBoxLayout *mainLayout;
  QVBoxLayout *settingsLayout;
  QGridLayout *pointsLayout;
  QGridLayout *canvasLayout;

  void init();

private slots:
  void setcanvasColor();
  void setgridColor();
  void setcurveColor();
  void boxClicked();
};

#endif // QPLOTSETTINGS_H
